package com.imporven.sell.controller;

import com.imporven.sell.result.ResponseResult;
import com.imporven.sell.util.ResultUtil;
import com.imporven.sell.vo.ProductVo;
import com.imporven.sell.vo.FoodsVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * @author imporven
 * @version 1.0.0
 * @date 2018-7-7 21:13
 */
@RestController
@RequestMapping("/sell/buyer")
public class ProductInfoController {

    @GetMapping("/product/list")
    public ResponseResult<ProductVo> productList(){
        List<ProductVo> products = new ArrayList<ProductVo>();
        ProductVo productVo = new ProductVo();
        productVo.setName("热榜");
        productVo.setType(1);
        FoodsVo foodsVo = new FoodsVo();
        foodsVo.setId("123456");
        foodsVo.setName("皮蛋粥");
        foodsVo.setPrice(BigDecimal.valueOf(1.2));
        foodsVo.setDescription("好吃的皮蛋粥");
        foodsVo.setIcon("http://xxx.com");
        List<FoodsVo> foodsVos = new ArrayList<FoodsVo>();
        foodsVos.add(foodsVo);
        productVo.setFoods(foodsVos);
        return ResultUtil.success(productVo);
    }

}
